package pers.course.test;

import java.util.Scanner;

public class Bin2Dec {
    public static void main(String[] args) {
        String binStr;
        int binStrLen;
        int dec = 0;
        char binChar;
        Scanner in = new Scanner(System.in);
        binStr = in.next();
        binStrLen = binStr.length();
        for (int exp = 0; exp < binStrLen; exp++) {
            binChar = binStr.charAt(binStrLen - 1 - exp);
            if (binChar == '1') {
                dec += (int)Math.pow(2, exp);
            } else if (binChar == '0'){
            } else {
                System.out.println("error: inValid binary string \"" + binStr + "\"");
            }
        }
        System.out.println("The equivalent decimal for \"" + binStr + "\" is " + dec);
        in.close();
    }
}
